<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>展示饮品信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css"/>
</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    <%--2005/02/17
                    curdate()--%>
                    <%
                        Date d = new Date();
                        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        String now = df.format(d);
                    %>

                    当前时间：<%=now %>
                    <br/>
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">main</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>
                Welcome!
            </h1>
            <form method="post" action="${pageContext.request.contextPath}/tea/batchDle.do">
                <table class="table">
                    <tr class="table_header">
                        <td>
                            全选
                        </td>
                        <td>
                            编号
                        </td>
                        <td>
                            饮品名称
                        </td>
                        <td>
                            饮品价格
                        </td>
                        <td>
                            上架时间
                        </td>
                        <td>
                            类别名称
                        </td>
                        <td>
                            操作
                        </td>
                    </tr>

                    <%--<tr>
                        <td>
                           <input type="checkbox" name="ids" value=""/>
                        </td>
                        <td>
                            1
                        </td>
                        <td>
                            抹茶奶盖
                        </td>
                        <td>
                            7
                        </td>
                        <td>
                             2017-5-5
                        </td>
                        <td>
                            奶盖
                        </td>
                        <td>
                            <a href="#">删除饮品</a>&nbsp;<a href="updateTea.jsp">修改饮品</a>
                        </td>
                    </tr>--%>


                    <c:forEach items="${requestScope.pi.list}" var="tea">
                        <tr>
                            <td>
                                <input type="checkbox" name="ids" value="${tea.id}" />
                            </td>
                            <td>${tea.id}</td>
                            <td>${tea.name}</td>
                            <td>${tea.price}</td>
                            <td>${tea.time}</td>
                            <td>${tea.category.name}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}/tea/deleteByID.do?id=${tea.id}">删除饮品</a>&nbsp;<a
                                    href="${pageContext.request.contextPath}/tea/selectById.do?id=${tea.id}">修改饮品</a>
                            </td>
                        </tr>
                    </c:forEach>
                    <tr>

                        <td colspan="5" align="left">
                            当前页数：${requestScope.pi.pageNum}&nbsp;&nbsp;总页数：${requestScope.pi.pages}
                        </td>
                        <td align="right">
                            <c:if test="${requestScope.pi.hasPreviousPage}">
                                <a href="${pageContext.request.contextPath}/tea/selectAll.do?curPage=1">首页</a>
                                <a href="${pageContext.request.contextPath}/tea/selectAll.do?curPage=${pi.prePage}">上一页</a>
                            </c:if>
                            <c:if test="${requestScope.pi.hasNextPage}">
                                <a href="${pageContext.request.contextPath}/tea/selectAll.do?curPage=${pi.nextPage}">下一页</a>
                                <a href="${pageContext.request.contextPath}/tea/selectAll.do?curPage=${pi.pages}">尾页</a>
                            </c:if>


                        </td>
                    </tr>

                </table>
                <input type="submit" value="删除勾选项"/>
            </form>
            <p>
                <a href="${pageContext.request.contextPath}/category/selectAll.do">添加饮品</a>
                <a href="${pageContext.request.contextPath}/category/selectAll3.do">查看所有类别</a>
            </p>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            联系作者：1804676959@qq.com
        </div>
    </div>
</div>
</body>
</html>
